﻿<Window x:Class="CPPEI.Coolzon.Designer.Views.WorkSpaceSelectView"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
             xmlns:local="clr-namespace:CPPEI.Coolzon.Designer.Views"
             mc:Ignorable="d" 
             d:DesignHeight="300" d:DesignWidth="300" Loaded="Window_Loaded" Closing="Window_Closing" WindowState="Normal" WindowStartupLocation="CenterScreen"  Title="创建工作空间"  Width="500"
             Style="{DynamicResource WindowStyle}">
    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto"></RowDefinition>
            <RowDefinition Height="*"></RowDefinition>
        </Grid.RowDefinitions>
        <StackPanel Style="{DynamicResource ButtonPanelBackground}" Grid.Row="0" Orientation="Horizontal"   >
            <Button x:Name="_btnNewWorkSpace" Style="{DynamicResource LongButtonStyle}" Content="新建工作空间" HorizontalAlignment="Left"  VerticalAlignment="Top" Width="95" Click="_btnNewWorkSpace_Click" Margin="3"/>
            <Button Name="_btnRetry" Style="{DynamicResource LongButtonStyle}"  Content="获取工作空间失败,点击重试" Height="20" Width="200" Visibility="Collapsed" Margin="3" Click="btnRetry_Click"/>
        </StackPanel>
        <Grid Grid.Row="1"  Margin="0,0,0,0.5">
            <TextBlock x:Name="_ctlTbMessage" Text="正在获取工作空间列表..." Grid.Row="1" Visibility="Visible"/>
            <ListView  x:Name="_ctlwpListView" Visibility="Collapsed" >
                <ListView.View >
                    <GridView>
                        <GridView.Columns>
                            <GridViewColumn>
                                <GridViewColumn.HeaderTemplate>
                                    <DataTemplate>
                                        <Grid>
                                            <TextBlock HorizontalAlignment="Center" Margin="2" Text="路径"/>
                                        </Grid>
                                    </DataTemplate>
                                </GridViewColumn.HeaderTemplate>
                                <GridViewColumn.CellTemplate>
                                    <DataTemplate>
                                        <TextBlock Text="{Binding Path=LocalPath}" Margin="10"></TextBlock>
                                    </DataTemplate>
                                </GridViewColumn.CellTemplate>
                            </GridViewColumn>
                            <GridViewColumn>
                                <GridViewColumn.HeaderTemplate>
                                    <DataTemplate>
                                        <Grid>
                                            <TextBlock HorizontalAlignment="Center" Margin="2" Text="创建信息"/>
                                        </Grid>
                                    </DataTemplate>
                                </GridViewColumn.HeaderTemplate>
                                <GridViewColumn.CellTemplate>
                                    <DataTemplate>
                                        <Grid Grid.Column="1">
                                            <Grid.RowDefinitions>
                                                <RowDefinition Height="1*"/>
                                                <RowDefinition Height="1*"/>
                                            </Grid.RowDefinitions>
                                            <Grid.ColumnDefinitions>
                                                <ColumnDefinition Width="1*"/>
                                                <ColumnDefinition Width="1*"/>
                                            </Grid.ColumnDefinitions>
                                            <TextBlock Grid.Row="0" Grid.Column="0" Text="创建人:"/>
                                            <TextBlock Grid.Row="0" Grid.Column="1" Text="{Binding Path=Creator}"/>
                                            <TextBlock Grid.Row="1" Grid.Column="0" Text="创建时间:"/>
                                            <TextBlock Grid.Row="1" Grid.Column="1" Text="{Binding Path=CreatedTimeString}"/>
                                        </Grid>
                                    </DataTemplate>
                                </GridViewColumn.CellTemplate>
                            </GridViewColumn>
                            <GridViewColumn>
                                <GridViewColumn.HeaderTemplate>
                                    <DataTemplate>
                                        <Grid>
                                            <TextBlock HorizontalAlignment="Center" Margin="2" Text=""/>
                                        </Grid>
                                    </DataTemplate>
                                </GridViewColumn.HeaderTemplate>
                                <GridViewColumn.CellTemplate>
                                    <DataTemplate>
                                        <Button Grid.Column="2" Content="进入" Click="BtnWS_Click" Tag="{Binding BindsDirectlyToSource=True}" Style="{DynamicResource ShortButtonStyle}" Width="60" />
                                    </DataTemplate>
                                </GridViewColumn.CellTemplate>
                            </GridViewColumn>
                        </GridView.Columns>
                    </GridView>
                </ListView.View>
            </ListView>
        </Grid>
    </Grid>
</Window>
